/**
 * Copyright HCP Technology 
 * www.hcp.vn
 */
package models;

import java.io.Serializable;

import siena.Id;
import siena.Model;
import siena.Query;

public class PictureModel extends Model implements Serializable  {
	
	@Id
	public Long id;
	public byte[] file;
	public String fileName;
	public String contentType;
	
	public PictureModel(byte[] file, String fileName, String contentType) {
		this.file = file;
		this.fileName = fileName;
		this.contentType = contentType;
	}

	static Query<PictureModel> all(){
		return Model.all(PictureModel.class);
	}
	
	public static PictureModel getById(Long id){
		return all().getByKey(id);
	}
	
}
